//
//  MyDotaDelegate.m
//  MyDota
//
//  Created by 濮亚军 on 15/12/2.
//  Copyright © 2015年 濮亚军. All rights reserved.
//

#import "MyDotaDelegate.h"


@implementation MyDotaDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    //设置window
    self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    
    //设置状态栏的字体颜色
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    
    //设置主controller
    MainController *mainViewVc = [[MainController alloc]init];
    UINavigationController *mainNav = [[UINavigationController alloc]initWithRootViewController:mainViewVc];
    // 设置所有BarTint颜色
    [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:40 / 255.0 green:40 / 255.0 blue:40 / 255.0 alpha:1.0]];
    
    //设置字体颜色
    UIColor * color = [UIColor whiteColor];
    //这里我们设置的是颜色，还可以设置shadow等，具体可以参见api
    NSDictionary * dict = [NSDictionary dictionaryWithObject:color forKey:NSForegroundColorAttributeName];
    [[UINavigationBar appearance] setTitleTextAttributes:dict];
    
    self.window.rootViewController = mainNav;
    
    //测试打印
    //NSLog(@"kWProportion === %f kHProportion ===== %f", kWProportion, kHProportion);
    
    //注册bmob
    [self registerBmob];
    
    return YES;
}
#pragma mark--------注册bmob--------
-(void)registerBmob
{
    //NSLog(@"kBmober = %@", kBmober);
    [Bmob registerWithAppKey:kBmober];
}
- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


@end
